package com.platform.dao;

import com.platform.entity.OrderEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

/**
 * 
 * 
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2017-08-13 10:41:09
 */
public interface OrderDao extends BaseDao<OrderEntity> {
	@Select("select IFNULL(sum(order_price), 0) as totalPrice from nideshop_order where id in (${subUsers}) and pay_status = 2")
	BigDecimal getSubUsersOrderPrice(@Param("subUsers") String usbUsers);

	@Update("update nideshop_order set coupon_id = null, coupon_price = null where id = #{id}")
	int cancelCoupon(@Param("id") Integer id);
}
